package behavioral.observer.inJava;

import java.util.Observable;
import java.util.Observer;

public class ListenerB implements Observer {

    public ListenerB(Observable o) {
        o.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {
        Button btn = (Button) o;
        Event event = (Event) arg;
        System.out.println("监听器B收到");
        System.out.println(event.msg);
    }
}
